﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace Terraria.ModLoader
{
	// Token: 0x0200020C RID: 524
	public static class WaterfallStyleLoader
	{
		// Token: 0x06001703 RID: 5891 RVA: 0x00417438 File Offset: 0x00415638
		internal static int ReserveStyle()
		{
			int result = WaterfallStyleLoader.nextWaterfallStyle;
			WaterfallStyleLoader.nextWaterfallStyle++;
			return result;
		}

		// Token: 0x06001704 RID: 5892 RVA: 0x000118C1 File Offset: 0x0000FAC1
		public static ModWaterfallStyle GetWaterfallStyle(int style)
		{
			if (style < 23 || style >= WaterfallStyleLoader.nextWaterfallStyle)
			{
				return null;
			}
			return WaterfallStyleLoader.waterfallStyles[style - 23];
		}

		// Token: 0x06001705 RID: 5893 RVA: 0x000118E0 File Offset: 0x0000FAE0
		internal static void ResizeArrays()
		{
			Array.Resize<Texture2D>(ref Main.instance.waterfallManager.waterfallTexture, WaterfallStyleLoader.nextWaterfallStyle);
		}

		// Token: 0x06001706 RID: 5894 RVA: 0x000118FB File Offset: 0x0000FAFB
		internal static void Unload()
		{
			WaterfallStyleLoader.nextWaterfallStyle = 23;
			WaterfallStyleLoader.waterfallStyles.Clear();
		}

		// Token: 0x040015D9 RID: 5593
		public const int vanillaWaterfallCount = 23;

		// Token: 0x040015DA RID: 5594
		private static int nextWaterfallStyle = 23;

		// Token: 0x040015DB RID: 5595
		internal static readonly IList<ModWaterfallStyle> waterfallStyles = new List<ModWaterfallStyle>();
	}
}
